package com.sven;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Value;

//dubbo中提供的@Service注解发布服务
@Service
//配置容错方式，快速失败模式；负载均衡策略为轮训
// @Service(cluster = "failfast", loadbalance = "roundrobin")
public class HelloServiceImpl implements IHelloService{

    @Value("${dubbo.application.name}")
    private String serviceName;

    @Override
    public String sayHello(String name) {
        // int a = 0;
        // int b = 2 / a;
        String str = "*************************service: " + serviceName + ", receive data: " + name;
        System.out.println(str);
        return str;
    }
}
